<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <title>My JSP 'addressbookadd.jsp' starting page</title>

    <meta content="no-cache" http-equiv="pragma">
    <meta content="no-cache" http-equiv="cache-control">
    <meta content="0" http-equiv="expires">
    <meta content="keyword1,keyword2,keyword3" http-equiv="keywords">
    <meta content="This is my page" http-equiv="description">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script type="text/javascript">
        function a() {
            var flag = false;
            var s_name = document.getElementById("s_name").value;
            var s_username = document.getElementById("s_username").value;
            var s_password = document.getElementById("s_password").value;
            if (s_name === "") {
                alert("学生姓名不能为空");
            } else if (s_username === "") {
                alert("学生用户名不能为空");
            } else if (s_password === "") {
                alert("学生密码不能为空");
            } else {
                flag = true;
            }
            return flag;
        }
    </script>
</head>

<body>
<div>学生信息修改</div>
<form action="${ctx}/StudentUpdateAction" method="post">
    <table>
        <tr>
            <td>学号</td>
            <td><input name="s_id" type="text" value="${lstt[0]}" style="background-color: darkgrey"
                       readonly="readonly"/></td>
        </tr>
        <tr>
            <td>姓名</td>
            <td><input id="s_name" name="s_name" value="${lstt[1]}"/></td>
        </tr>
        <tr>
            <td>用户名</td>
            <td><input id="s_username" name="s_username" value="${lstt[2]}"/></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input id="s_password" name="s_password" value="${lstt[3]}"/></td>
        </tr>
        <tr>
            <td><input onclick="return a()" type="submit" value="修改"/></td>
        </tr>
    </table>
</form>
<a href="${ctx}/StudentFindAll">返回</a>
</body>
</html>
